package com.eaero.tools.controller;

import cn.hutool.core.util.StrUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin
@RestController
public class TestController {
    private final Logger log = LoggerFactory.getLogger(TestController.class);

    @RequestMapping("/test")
    public String test(@RequestParam("name") String name) {
        String content = StrUtil.format("tools name is : {}", name);
        try {
            log.info(content);
        } catch (Exception e) {
            log.error("test error", e);
        }
        return content;
    }

}
